Skip to content

fix(snapshot): fix flagging obsolete snapshots for snapshot properties mismatch#9986

Merged
sheremet-va merged 9 commits intovitest-dev:mainfrom
hi-ogawa:fix-false-flagging-obsolete-snapshots-for-snapshot-properties-mismatch
Mar 27, 2026
Merged

fix(snapshot): fix flagging obsolete snapshots for snapshot properties mismatch#9986
sheremet-va merged 9 commits intovitest-dev:mainfrom
hi-ogawa:fix-false-flagging-obsolete-snapshots-for-snapshot-properties-mismatch

Conversation

@hi-ogawa
Copy link
Copy Markdown
Collaborator

@hi-ogawa hi-ogawa commented Mar 27, 2026

Description

This fix needs similar mechanism as poll snapshot from #9973, so I copied the code from there (namely probeExpectedSnapshot).

Splitting current SnapshotClient.assert into match + assert is picked up from custom matcher support PR #9973. This is minor cleanup for this PR alone, but just preparing for it.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@hi-ogawa hi-ogawa changed the title fix: false-flagging obsolete snapshots for snapshot properties mismatch fix: fix false-flagging obsolete snapshots for snapshot properties mismatch Mar 27, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit aeffebd
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/69c5f06e8b67320008d3c55f
😎 Deploy Preview https://deploy-preview-9986--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hi-ogawa hi-ogawa changed the title fix: fix false-flagging obsolete snapshots for snapshot properties mismatch fix: fix flagging obsolete snapshots for snapshot properties mismatch Mar 27, 2026
@hi-ogawa hi-ogawa marked this pull request as ready for review March 27, 2026 03:49
@hi-ogawa hi-ogawa changed the title fix: fix flagging obsolete snapshots for snapshot properties mismatch fix(snapshot: fix flagging obsolete snapshots for snapshot properties mismatch Mar 27, 2026
@hi-ogawa hi-ogawa changed the title fix(snapshot: fix flagging obsolete snapshots for snapshot properties mismatch fix(snapshot): fix flagging obsolete snapshots for snapshot properties mismatch Mar 27, 2026
@sheremet-va sheremet-va merged commit 6b86915 into vitest-dev:main Mar 27, 2026
13 of 16 checks passed
@hi-ogawa hi-ogawa deleted the fix-false-flagging-obsolete-snapshots-for-snapshot-properties-mismatch branch March 27, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

obsolete snapshot reported when snapshot fails with toMatchSnapshot(propertes)

2 participants